package com.css.zfzx.sjcj.modules.hddcTargetRegion.repository;

import com.css.zfzx.sjcj.modules.hddcA1InvRgnHasMaterialTable.repository.entity.HddcA1InvrgnhasmaterialtableEntity;
import com.css.zfzx.sjcj.modules.hddcTargetRegion.repository.entity.HddcTargetregionEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author zyb
 * @date 2020-11-30
 */
public interface HddcTargetregionRepository extends JpaRepository<HddcTargetregionEntity, String> {
    @Query(nativeQuery = true,value="select t.* from hddc_targetregion  t where t.id=?1 and t.is_valid=1")
    HddcTargetregionEntity findbyId(String id);
    @Modifying
    @Query(nativeQuery = true,value = "update hddc_targetregion set qualityinspection_status=:s ,extends1=:str where uuid=:id")
    void updateStatus(String s, String str, String id);

    @Query(nativeQuery = true,value = "select * from hddc_targetregion where is_valid=1 and extends10=1 ")
    List<HddcTargetregionEntity> findByAll();

    HddcTargetregionEntity findByUuidAndIsValid(String id, String isValid);
}
